import jsonp from 'common/js/jsonp'
import {
  commonParams,
  options
} from "./config"
import axios from 'axios'

export function getLyric(mid) {
  const url = `https://api.gsanweb.cn/music`

  const data = Object.assign({}, commonParams, {
    id: mid,
    source: 'tencent',
    types: 'lyric'
  })

  return axios.get(url, {
    params: data
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}

export function getUrl(mid) {
  const url = `https://api.gsanweb.cn/music`

  const data = Object.assign({}, commonParams, {
    id: mid,
    source: 'tencent',
    types: 'url'
  })

  return axios.get(url, {
    params: data
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}
